package org.china.lanzhou.grid;

import lombok.Getter;
import lombok.Setter;
import org.apache.commons.collections4.queue.CircularFifoQueue;
import java.util.*;

/**
 * 拥有触发器
 * 前置，后置，等等
 */
@Getter
@Setter
public final class Element{
    final static int QUEUE_SIZE = 20;
    private int index;
    private Map<Element,Double> antennaMap = new LinkedHashMap<>();
    private List<Element> affinity = new LinkedList<>(); //
    private Queue queue = new CircularFifoQueue(QUEUE_SIZE);  // 小单元记录，访问记录栈(有开始记录与结束记录)
    @Override
    public boolean equals(Object obj) {
        if(obj instanceof Element){
            return ((Element)obj).getIndex()==this.index;
        }
        return super.equals(obj);
    }

    // 激活事件
    public void onActuator(){

    }

}